package br.utfpr.edu.bean;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@Entity
@Table(name = "BED")
public class Bed implements Serializable {
	
	private static final long serialVersionUID = 5323644309035910367L;

	@Id
    @Column(name ="ID")
    @GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	@Column(name = "CHROM")
	private String chrom;
	@Column(name = "CHROMSTART")
	private Integer chromStart;
	@Column(name = "CHROMEND")
	private Integer chromEnd;
	@Column(name = "NAME")
	private String name;
	@Column(name = "SCORE")
	private String score;
	@Column(name = "STRAND")
	private String strand;
	@Column(name = "THICKSTART")
	private String thickStart;
	@Column(name = "THICKEND")
	private String thickEnd;
	@Column(name = "ITEMRGB")
	private String itemRgb;
	@Column(name = "BLOCKCOUNT")
	private String blockCount;
	@Column(name = "BLOCKSIZES")
	private String blockSizes;
	@Column(name = "BLOCKSTARTS")
	private String blockStarts;
	@JoinColumn(name="USUARIO",referencedColumnName="US_ID")
	@ManyToOne(optional = false)
	private Usuario usuario;
	@JoinColumn(name="GENE",referencedColumnName="ID")
	@ManyToOne(optional = false)
	private Gene gene;
	
	public Bed(){
		usuario = new Usuario();
		gene = new Gene();
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getChrom() {
		return chrom;
	}
	public void setChrom(String chrom) {
		this.chrom = chrom;
	}
	public Integer getChromStart() {
		return chromStart;
	}
	public void setChromStart(Integer chromStart) {
		this.chromStart = chromStart;
	}
	public Integer getChromEnd() {
		return chromEnd;
	}
	public void setChromEnd(Integer chromEnd) {
		this.chromEnd = chromEnd;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getScore() {
		return score;
	}
	public void setScore(String score) {
		this.score = score;
	}
	public String getStrand() {
		return strand;
	}
	public void setStrand(String strand) {
		this.strand = strand;
	}
	public String getThickStart() {
		return thickStart;
	}
	public void setThickStart(String thickStart) {
		this.thickStart = thickStart;
	}
	public String getThickEnd() {
		return thickEnd;
	}
	public void setThickEnd(String thickEnd) {
		this.thickEnd = thickEnd;
	}
	public String getItemRgb() {
		return itemRgb;
	}
	public void setItemRgb(String itemRgb) {
		this.itemRgb = itemRgb;
	}
	public String getBlockCount() {
		return blockCount;
	}
	public void setBlockCount(String blockCount) {
		this.blockCount = blockCount;
	}
	public String getBlockSizes() {
		return blockSizes;
	}
	public void setBlockSizes(String blockSizes) {
		this.blockSizes = blockSizes;
	}
	public String getBlockStarts() {
		return blockStarts;
	}
	public void setBlockStarts(String blockStarts) {
		this.blockStarts = blockStarts;
	}
	public Usuario getUsuario() {
		return usuario;
	}
	public void setUsuario(Usuario usuario) {
		this.usuario = usuario;
	}
	public Gene getGene() {
		return gene;
	}
	public void setGene(Gene gene) {
		this.gene = gene;
	}
	@Override
	public int hashCode() {
		final int prime = 235;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Bed other = (Bed) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
}
